<link rel="stylesheet" type="text/css" href="/assets/css/formSelects-v4.css"/>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <input type="hidden" name="row[id]" value="{$row['id']}">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Classroom')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline" data-toggle="cxselect" data-selects="school,garden,building,classroom">
                <select class="form-control school" name="row[school_id]" data-url="school/cxSelect">
                    <option value="{$row.school_id}" selected=""></option>
                </select>
                <select class="form-control garden" name="row[garden_id]" data-url="garden/cxSelect" data-query-name="school_id">
                    <option value="{$row.garden_id}" selected=""></option>
                </select>
                <select class="form-control building" name="row[building_id]" data-url="building/cxSelect?type=1" data-query-name="garden_id">
                    <option value="{$row.building_id}" selected=""></option>
                </select>
                <select class="form-control classroom" name="row[classroom_id]" data-url="classroom/cxSelect" data-query-name="building_id">
                    <option value="{$row.classroom_id}" selected=""></option>
                </select>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Grade')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[grade_id]', $gradeData, $row['grade_id'], ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
        </div>
    </div>

    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}" data-rule="required">
        </div>
    </div>

    <div class="form-group">
        <label for="c-logo" class="control-label col-xs-12 col-sm-2">{:__('班徽')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" id="c-logo" name="row[logo]" class="form-control" value="{$row.logo|htmlentities}" readonly/>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button id="plupload-logo" class="btn btn-primary plupload" data-input-id="c-logo" data-url="{:url('ajax/upload')}"><i class="fa fa-upload"></i> {:__("上传")}</button>
            <span>建议尺寸430*280像素</span>
        </div>
    </div>

    <div class="form-group">
        <label for="c-headmaster" class="control-label col-xs-12 col-sm-2">{:__('班主任')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select class="teacher" name="row[headmaster]" xm-select="headmaster" xm-select-radio="" xm-select-search="">
                {if $row['headmaster'] > 0 && isset($row['headmaster_name'])}
                <option value="{$row['headmaster']}" selected="selected">{$row['headmaster_name']}</option>
                {/if}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label for="c-slogan" class="control-label col-xs-12 col-sm-2">{:__('口号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-slogan" cols="2" rows="5" class="form-control" name="row[slogan]" type="text" >{$row.slogan|htmlentities}</textarea>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script id="tpl" type="text/html">
    <%for(var i=0; i< data.length; i++){%>
    <option value="<%=data[i].value%>"><%=data[i].name%></option>
    <%}%>
</script>
